3.52 \(\int x (a+b \log (c x^n))^2 \, dx\)

Optimal. Leaf size=52 \[ \frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{2} b n x^2 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{4} b^2 n^2 x^2 \]

[Out]

1/4*b^2*n^2*x^2-1/2*b*n*x^2*(a+b*ln(c*x^n))+1/2*x^2*(a+b*ln(c*x^n))^2

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2305, 2304} \[ \frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{2} b n x^2 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{4} b^2 n^2 x^2 \]

Antiderivative was successfully verified.

[In]

Int[x*(a + b*Log[c*x^n])^2,x]

[Out]

(b^2*n^2*x^2)/4 - (b*n*x^2*(a + b*Log[c*x^n]))/2 + (x^2*(a + b*Log[c*x^n])^2)/2

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rubi steps

\begin {align*} \int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2-(b n) \int x \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=\frac {1}{4} b^2 n^2 x^2-\frac {1}{2} b n x^2 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{2} x^2 \left (a+b \log \left (c x^n\right )\right )^2\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 41, normalized size = 0.79 \[ \frac {1}{4} x^2 \left (2 \left (a+b \log \left (c x^n\right )\right )^2+b n \left (-2 a-2 b \log \left (c x^n\right )+b n\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*Log[c*x^n])^2,x]

[Out]

(x^2*(b*n*(-2*a + b*n - 2*b*Log[c*x^n]) + 2*(a + b*Log[c*x^n])^2))/4

________________________________________________________________________________________

fricas [B]  time = 0.45, size = 102, normalized size = 1.96 \[ \frac {1}{2} \, b^{2} n^{2} x^{2} \log \relax (x)^{2} + \frac {1}{2} \, b^{2} x^{2} \log \relax (c)^{2} - \frac {1}{2} \, {\left (b^{2} n - 2 \, a b\right )} x^{2} \log \relax (c) + \frac {1}{4} \, {\left (b^{2} n^{2} - 2 \, a b n + 2 \, a^{2}\right )} x^{2} + \frac {1}{2} \, {\left (2 \, b^{2} n x^{2} \log \relax (c) - {\left (b^{2} n^{2} - 2 \, a b n\right )} x^{2}\right )} \log \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

1/2*b^2*n^2*x^2*log(x)^2 + 1/2*b^2*x^2*log(c)^2 - 1/2*(b^2*n - 2*a*b)*x^2*log(c) + 1/4*(b^2*n^2 - 2*a*b*n + 2*
a^2)*x^2 + 1/2*(2*b^2*n*x^2*log(c) - (b^2*n^2 - 2*a*b*n)*x^2)*log(x)

________________________________________________________________________________________

giac [B]  time = 0.29, size = 108, normalized size = 2.08 \[ \frac {1}{2} \, b^{2} n^{2} x^{2} \log \relax (x)^{2} - \frac {1}{2} \, b^{2} n^{2} x^{2} \log \relax (x) + b^{2} n x^{2} \log \relax (c) \log \relax (x) + \frac {1}{4} \, b^{2} n^{2} x^{2} - \frac {1}{2} \, b^{2} n x^{2} \log \relax (c) + \frac {1}{2} \, b^{2} x^{2} \log \relax (c)^{2} + a b n x^{2} \log \relax (x) - \frac {1}{2} \, a b n x^{2} + a b x^{2} \log \relax (c) + \frac {1}{2} \, a^{2} x^{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

1/2*b^2*n^2*x^2*log(x)^2 - 1/2*b^2*n^2*x^2*log(x) + b^2*n*x^2*log(c)*log(x) + 1/4*b^2*n^2*x^2 - 1/2*b^2*n*x^2*
log(c) + 1/2*b^2*x^2*log(c)^2 + a*b*n*x^2*log(x) - 1/2*a*b*n*x^2 + a*b*x^2*log(c) + 1/2*a^2*x^2

________________________________________________________________________________________

maple [C]  time = 0.21, size = 692, normalized size = 13.31 \[ \frac {b^{2} x^{2} \ln \left (x^{n}\right )^{2}}{2}+\frac {\left (-i \pi b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+i \pi b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+i \pi b \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}-i \pi b \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-b n +2 b \ln \relax (c )+2 a \right ) b \,x^{2} \ln \left (x^{n}\right )}{2}+\frac {\left (-\pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+2 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+2 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-4 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{4}+2 i \pi \,b^{2} n \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-4 i \pi \,b^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{3} \ln \relax (c )-4 i \pi a b \mathrm {csgn}\left (i c \,x^{n}\right )^{3}+4 a^{2}-2 i \pi \,b^{2} n \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}-2 i \pi \,b^{2} n \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi \,b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (c )+4 i \pi \,b^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (c )+4 i \pi a b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi a b \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+2 b^{2} n^{2}-\pi ^{2} b^{2} \mathrm {csgn}\left (i c \right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{4}+2 \pi ^{2} b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{5}-\pi ^{2} b^{2} \mathrm {csgn}\left (i x^{n}\right )^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{4}+2 \pi ^{2} b^{2} \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{5}+8 a b \ln \relax (c )-4 b^{2} n \ln \relax (c )+4 b^{2} \ln \relax (c )^{2}-4 a b n -\pi ^{2} b^{2} \mathrm {csgn}\left (i c \,x^{n}\right )^{6}-4 i \pi \,b^{2} \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) \ln \relax (c )-4 i \pi a b \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+2 i \pi \,b^{2} n \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )\right ) x^{2}}{8} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*ln(c*x^n))^2,x)

[Out]

1/2*b^2*x^2*ln(x^n)^2+1/2*b*x^2*(I*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)
-I*Pi*b*csgn(I*c*x^n)^3+I*Pi*b*csgn(I*c)*csgn(I*c*x^n)^2+2*b*ln(c)-b*n+2*a)*ln(x^n)+1/8*x^2*(-Pi^2*b^2*csgn(I*
c)^2*csgn(I*x^n)^2*csgn(I*c*x^n)^2-4*Pi^2*b^2*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)^4+2*Pi^2*b^2*csgn(I*c)^2*csg
n(I*x^n)*csgn(I*c*x^n)^3+2*I*Pi*b^2*n*csgn(I*c*x^n)^3+2*Pi^2*b^2*csgn(I*c)*csgn(I*x^n)^2*csgn(I*c*x^n)^3-4*I*P
i*a*b*csgn(I*c*x^n)^3-4*I*ln(c)*Pi*b^2*csgn(I*c*x^n)^3+4*a^2+2*b^2*n^2+8*a*b*ln(c)-4*b^2*n*ln(c)+4*b^2*ln(c)^2
-Pi^2*b^2*csgn(I*x^n)^2*csgn(I*c*x^n)^4+2*Pi^2*b^2*csgn(I*x^n)*csgn(I*c*x^n)^5-4*a*b*n-Pi^2*b^2*csgn(I*c*x^n)^
6+2*Pi^2*b^2*csgn(I*c)*csgn(I*c*x^n)^5-Pi^2*b^2*csgn(I*c)^2*csgn(I*c*x^n)^4+4*I*Pi*a*b*csgn(I*c*x^n)^2*csgn(I*
c)-2*I*Pi*b^2*n*csgn(I*x^n)*csgn(I*c*x^n)^2-2*I*Pi*b^2*n*csgn(I*c)*csgn(I*c*x^n)^2+4*I*ln(c)*Pi*b^2*csgn(I*x^n
)*csgn(I*c*x^n)^2+4*I*ln(c)*Pi*b^2*csgn(I*c*x^n)^2*csgn(I*c)+4*I*Pi*a*b*csgn(I*x^n)*csgn(I*c*x^n)^2-4*I*ln(c)*
Pi*b^2*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)+2*I*Pi*b^2*n*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)-4*I*Pi*a*b*csgn(I*
x^n)*csgn(I*c*x^n)*csgn(I*c))

________________________________________________________________________________________

maxima [A]  time = 0.60, size = 70, normalized size = 1.35 \[ \frac {1}{2} \, b^{2} x^{2} \log \left (c x^{n}\right )^{2} - \frac {1}{2} \, a b n x^{2} + a b x^{2} \log \left (c x^{n}\right ) + \frac {1}{2} \, a^{2} x^{2} + \frac {1}{4} \, {\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} b^{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

1/2*b^2*x^2*log(c*x^n)^2 - 1/2*a*b*n*x^2 + a*b*x^2*log(c*x^n) + 1/2*a^2*x^2 + 1/4*(n^2*x^2 - 2*n*x^2*log(c*x^n
))*b^2

________________________________________________________________________________________

mupad [B]  time = 3.48, size = 60, normalized size = 1.15 \[ x^2\,\left (\frac {a^2}{2}-\frac {a\,b\,n}{2}+\frac {b^2\,n^2}{4}\right )+x^2\,\ln \left (c\,x^n\right )\,\left (a\,b-\frac {b^2\,n}{2}\right )+\frac {b^2\,x^2\,{\ln \left (c\,x^n\right )}^2}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a + b*log(c*x^n))^2,x)

[Out]

x^2*(a^2/2 + (b^2*n^2)/4 - (a*b*n)/2) + x^2*log(c*x^n)*(a*b - (b^2*n)/2) + (b^2*x^2*log(c*x^n)^2)/2

________________________________________________________________________________________

sympy [B]  time = 0.93, size = 126, normalized size = 2.42 \[ \frac {a^{2} x^{2}}{2} + a b n x^{2} \log {\relax (x )} - \frac {a b n x^{2}}{2} + a b x^{2} \log {\relax (c )} + \frac {b^{2} n^{2} x^{2} \log {\relax (x )}^{2}}{2} - \frac {b^{2} n^{2} x^{2} \log {\relax (x )}}{2} + \frac {b^{2} n^{2} x^{2}}{4} + b^{2} n x^{2} \log {\relax (c )} \log {\relax (x )} - \frac {b^{2} n x^{2} \log {\relax (c )}}{2} + \frac {b^{2} x^{2} \log {\relax (c )}^{2}}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*ln(c*x**n))**2,x)

[Out]

a**2*x**2/2 + a*b*n*x**2*log(x) - a*b*n*x**2/2 + a*b*x**2*log(c) + b**2*n**2*x**2*log(x)**2/2 - b**2*n**2*x**2
*log(x)/2 + b**2*n**2*x**2/4 + b**2*n*x**2*log(c)*log(x) - b**2*n*x**2*log(c)/2 + b**2*x**2*log(c)**2/2

________________________________________________________________________________________